package com.zhiqiang.nativeplayer.controller;

import com.zhiqiang.nativeplayer.bean.ResourceListRetBean;
import com.zhiqiang.nativeplayer.handler.FileLoadHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * author：paul
 * date：Created in 19:19 2022/11/21
 */
@RestController
@Slf4j
public class ResourceList {

    @Autowired
    private FileLoadHandler fileLoadHandler;

    @RequestMapping("/getVideoList")
    public ResourceListRetBean toVideoList(){
        log.info("/getVideoList");
        ResourceListRetBean retBean = new ResourceListRetBean();
        retBean.setRetList(fileLoadHandler.getVideoList());

        return retBean;
    }

    @RequestMapping("/getPdfList")
    public ResourceListRetBean toPdfList(){
        log.info("/getPdfList");
        ResourceListRetBean retBean = new ResourceListRetBean();
        retBean.setRetList(fileLoadHandler.getPdfList());

        return retBean;
    }
}
